#include<stdio.h>
/*将数字转化成字符串*/
int main()
{
	int num = 12345;
	char str[10] = {0};
	int index = 0;

	while(num){
		str[index] = num % 10 + '0';  //变成对应的字符，故加上'0'
		num /= 10;
		index++;
	}

	//for(int i=0; i<index;i++){
	//	printf("%c",str[i]);
	//} 

	//反转整个数组
	int m = index/2;
	for(int i=0; i<=m; i++){
		char tmp = str[i];
		str[i] = str[index-1-i];
		str[index-1-i] = tmp;
	}
	
	//输出
    puts(str);

	return 0;
}
